/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ttfsclient;

import java.io.InputStream;
import java.io.ObjectInputStream;
import java.net.Socket;
import myutil.Protocol;

/**
 *
 * @author Tidus Le
 */
public class clsThreadProcess extends Thread
{
    Socket sock=null;

    public clsThreadProcess(Socket sock)
    {
        this.sock=sock;
    }
    
    @Override
    public void run()
    {
        try
        {   
            InputStream inStr=sock.getInputStream();
            ObjectInputStream objInStr=new ObjectInputStream(inStr);
            Protocol prot=(Protocol)objInStr.readObject();
            
            clsResponse response=new clsResponse(sock.getOutputStream());
            response.process(prot);
            
            inStr.close();
            objInStr.close();
            sock.close();
        }catch(Exception ex)
        {
            ex.printStackTrace();
        }
    }
}
